package com.winit.projectPlan.model;

import com.winit.commons.util.SeqGenerate;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
@Entity
@Table(name = "matrix_task")
@DynamicInsert
@DynamicUpdate
public class Task implements Serializable {
    @Id
    private String id;
    @Column(name = "number")
    private String number;  //任务编号
    @Column(name = "type")
    private String type;  //任务类型  目前已知的  SERVICE/TEST/UI
    @Column(name = "content")
    private String content;  //任务内容
    @Column(name = "status")
    private String status;  //任务状态   NEW/DONE/DOING
    @Column(name = "work_hours")
    private String workHours;  //工时
    @Column(name = "creater_account")
    private String createrAccount;
    @Column(name = "creater_realname")
    private String createrRealname;
    @Column(name = "charger_account")
    private String chargerAccount;  //负责人
    @Column(name = "charger_realname")
    private String chargerRealname;
    @Column(name = "project_plan_id")
    private String projectPlanId;
    @Column(name = "startup_time")
    private Date startupTime;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getWorkHours() {
        return workHours;
    }

    public void setWorkHours(String workHours) {
        this.workHours = workHours;
    }

    public String getCreaterAccount() {
        return createrAccount;
    }

    public void setCreaterAccount(String createrAccount) {
        this.createrAccount = createrAccount;
    }

    public String getCreaterRealname() {
        return createrRealname;
    }

    public void setCreaterRealname(String createrRealname) {
        this.createrRealname = createrRealname;
    }

    public String getChargerAccount() {
        return chargerAccount;
    }

    public void setChargerAccount(String chargerAccount) {
        this.chargerAccount = chargerAccount;
    }

    public String getChargerRealname() {
        return chargerRealname;
    }

    public void setChargerRealname(String chargerRealname) {
        this.chargerRealname = chargerRealname;
    }

    public String getProjectPlanId() {
        return projectPlanId;
    }

    public void setProjectPlanId(String projectPlanId) {
        this.projectPlanId = projectPlanId;
    }


    public static final String generateTaskNumber(){
        return "TSK" + SeqGenerate.createSerialNo();
    }

    public static final String generateId(){
        return SeqGenerate.createId("TSK");
    }

    public Date getStartupTime() {
        return startupTime;
    }

    public void setStartupTime(Date startupTime) {
        this.startupTime = startupTime;
    }
}
